<template>
	<view class="task-item" @click="onClick">
		<view class="task-title">{{options.title}}</view>
		<view class="task-user">{{options.userName}}<label class="task-company">{{options.company}}</label></view>
		<view class="task-time">{{options.time}}<label class="task-tips">{{options.tips}}</label></view>
		<label class="task-tag" :class="options.tag">{{options.tagLabel}}</label>
	</view>
</template>

<script>
	export default {
		name: "task-item",
		props: {
			options: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {

			};
		},
		methods: {
			onClick: function() {
				this.$emit("click", this.options.id)
			}
		}
	}
</script>

<style>
	.task-item {
		display: flex;
		flex-flow: column;
		padding: 24rpx 32rpx;
		box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.16);
		border-radius: 8rpx;
		margin: 5px;
		margin-bottom: 24rpx;
		position: relative;
	}

	.task-title {
		font-size: 32rpx;
		color: #181818;
		font-weight: 500;
		margin-bottom: 6rpx;
	}

	.task-user {
		color: #7B7B7B;
		font-size: 22rpx;
		margin-bottom: 6rpx;
	}

	.task-company {
		margin-left: 15rpx;
		padding-left: 15rpx;
		border-left: 1rpx solid #D2D2D2;
	}

	.task-time {
		font-size: 20rpx;
		color: #ACACAC;
		display: flex;
		justify-content: space-between;
	}

	.task-tips {}

	.task-tag {
		width: 138rpx;
		height: 48rpx;
		line-height: 48rpx;
		border-radius: 28rpx 0rpx 0rpx 28rpx;
		background-color: #D2D2D2;
		color: #FFFFFF;
		font-size: 28rpx;
		text-align: center;
		position: absolute;
		right: 0;
	}

	.blue {
		background-color: #1371FF;
	}

	.red {
		background-color: #FA5151;
	}

	.green {
		background-color: #91D300;
	}

	.orange {
		background-color: #FA9D3B;
	}

	.violet {
		background-color: #576B95;
	}

	.grey {
		background-color: #ACACAC;
	}
</style>
